home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolkit / vbof_v11 / democulb.frm < prev    next >
Text File  |  1996-03-03  |  42KB  |  1,469 lines

  1. VERSION 4.00
  2. Begin VB.Form CustomerDetailsListBoxNoDataControl 
  3.    Caption         =   "Customer Details (Pure OO example using ListBoxes)"
  4.    ClientHeight    =   6150
  5.    ClientLeft      =   825
  6.    ClientTop       =   750
  7.    ClientWidth     =   8820
  8.    Height          =   6870
  9.    Left            =   765
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6150
  12.    ScaleWidth      =   8820
  13.    Top             =   90
  14.    Width           =   8940
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "Count Sel"
  17.       Height          =   375
  18.       Left            =   7680
  19.       TabIndex        =   11
  20.       Top             =   1560
  21.       Width           =   975
  22.    End
  23.    Begin VB.ListBox List1 
  24.       Height          =   1815
  25.       Left            =   0
  26.       MultiSelect     =   2  'Extended
  27.       TabIndex        =   0
  28.       Top             =   120
  29.       Width           =   4215
  30.    End
  31.    Begin VB.CommandButton pbOK 
  32.       Cancel          =   -1  'True
  33.       Caption         =   "OK"
  34.       Default         =   -1  'True
  35.       Height          =   375
  36.       Left            =   7680
  37.       TabIndex        =   12
  38.       Top             =   2160
  39.       Width           =   975
  40.    End
  41.    Begin VB.CommandButton pbDeleteCustomer 
  42.       Caption         =   "Delete"
  43.       Height          =   375
  44.       Left            =   7680
  45.       TabIndex        =   10
  46.       Top             =   1080
  47.       Width           =   975
  48.    End
  49.    Begin VB.CommandButton pbUpdateCustomer 
  50.       Caption         =   "Update"
  51.       Height          =   375
  52.       Left            =   7680
  53.       TabIndex        =   9
  54.       Top             =   600
  55.       Width           =   975
  56.    End
  57.    Begin VB.CommandButton pbAddNewCustomer 
  58.       Caption         =   "Add New"
  59.       Height          =   375
  60.       Left            =   7680
  61.       TabIndex        =   8
  62.       Top             =   120
  63.       Width           =   975
  64.    End
  65.    Begin VB.Frame Frame1 
  66.       Caption         =   "Customer Details"
  67.       Height          =   2535
  68.       Left            =   4320
  69.       TabIndex        =   32
  70.       Top             =   0
  71.       Width           =   3255
  72.       Begin VB.ComboBox lbxGenderCodes 
  73.          Height          =   315
  74.          Left            =   2400
  75.          Sorted          =   -1  'True
  76.          TabIndex        =   7
  77.          Top             =   2160
  78.          Width           =   615
  79.       End
  80.       Begin VB.ComboBox lbxMaritalStatusCodes 
  81.          Height          =   315
  82.          Left            =   1200
  83.          Sorted          =   -1  'True
  84.          TabIndex        =   6
  85.          Top             =   2160
  86.          Width           =   855
  87.       End
  88.       Begin VB.TextBox efCustomerNumber 
  89.          Height          =   285
  90.          Left            =   1200
  91.          TabIndex        =   1
  92.          Top             =   360
  93.          Width           =   1815
  94.       End
  95.       Begin VB.TextBox efDateOfBirth 
  96.          Height          =   285
  97.          Left            =   1200
  98.          TabIndex        =   5
  99.          Top             =   1800
  100.          Width           =   1815
  101.       End
  102.       Begin VB.TextBox efFirstName 
  103.          Height          =   285
  104.          Left            =   1200
  105.          TabIndex        =   2
  106.          Top             =   720
  107.          Width           =   1815
  108.       End
  109.       Begin VB.TextBox efLastName 
  110.          Height          =   285
  111.          Left            =   1200
  112.          TabIndex        =   3
  113.          Top             =   1080
  114.          Width           =   1815
  115.       End
  116.       Begin VB.TextBox efSSN 
  117.          Height          =   285
  118.          Left            =   1200
  119.          TabIndex        =   4
  120.          Top             =   1440
  121.          Width           =   1815
  122.       End
  123.       Begin VB.Label Label1 
  124.          Caption         =   "Marital Status"
  125.          Height          =   255
  126.          Index           =   4
  127.          Left            =   120
  128.          TabIndex        =   57
  129.          Top             =   2160
  130.          Width           =   975
  131.       End
  132.       Begin VB.Label Label1 
  133.          Caption         =   "Sex"
  134.          Height          =   255
  135.          Index           =   11
  136.          Left            =   2040
  137.          TabIndex        =   56
  138.          Top             =   2160
  139.          Width           =   375
  140.       End
  141.       Begin VB.Label Label1 
  142.          Caption         =   "Cust Number"
  143.          Height          =   255
  144.          Index           =   12
  145.          Left            =   120
  146.          TabIndex        =   37
  147.          Top             =   360
  148.          Width           =   975
  149.       End
  150.       Begin VB.Label Label1 
  151.          Caption         =   "Date Of Birth"
  152.          Height          =   255
  153.          Index           =   3
  154.          Left            =   120
  155.          TabIndex        =   36
  156.          Top             =   1800
  157.          Width           =   975
  158.       End
  159.       Begin VB.Label Label1 
  160.          Caption         =   "First Name"
  161.          Height          =   255
  162.          Index           =   0
  163.          Left            =   120
  164.          TabIndex        =   35
  165.          Top             =   720
  166.          Width           =   975
  167.       End
  168.       Begin VB.Label Label1 
  169.          Caption         =   "Last Name"
  170.          Height          =   255
  171.          Index           =   1
  172.          Left            =   120
  173.          TabIndex        =   34
  174.          Top             =   1080
  175.          Width           =   975
  176.       End
  177.       Begin VB.Label Label1 
  178.          Caption         =   "SSN"
  179.          Height          =   255
  180.          Index           =   2
  181.          Left            =   120
  182.          TabIndex        =   33
  183.          Top             =   1440
  184.          Width           =   975
  185.       End
  186.    End
  187.    Begin TabDlg.SSTab SSTab1 
  188.       Height          =   3135
  189.       Left            =   0
  190.       TabIndex        =   13
  191.       Top             =   2640
  192.       Width           =   8775
  193.       _Version        =   65536
  194.       _ExtentX        =   15478
  195.       _ExtentY        =   5530
  196.       _StockProps     =   15
  197.       Caption         =   "Addresses"
  198.       TabsPerRow      =   2
  199.       Tab             =   0
  200.       TabOrientation  =   0
  201.       Tabs            =   2
  202.       Style           =   1
  203.       TabMaxWidth     =   0
  204.       TabHeight       =   529
  205.       TabCaption(0)   =   "Addresses"
  206.       Tab(0).ControlCount=   7
  207.       Tab(0).ControlEnabled=   -1  'True
  208.       Tab(0).Control(0)=   "Label1(13)"
  209.       Tab(0).Control(1)=   "efFormattedAddress"
  210.       Tab(0).Control(2)=   "Frame2"
  211.       Tab(0).Control(3)=   "pbDeleteAddress"
  212.       Tab(0).Control(4)=   "pbUpdateAddress"
  213.       Tab(0).Control(5)=   "pbAddNewAddress"
  214.       Tab(0).Control(6)=   "List2"
  215.       TabCaption(1)   =   "Phones"
  216.       Tab(1).ControlCount=   7
  217.       Tab(1).ControlEnabled=   0   'False
  218.       Tab(1).Control(0)=   "List3"
  219.       Tab(1).Control(1)=   "pbAddPhone"
  220.       Tab(1).Control(2)=   "pbUpdatePhone"
  221.       Tab(1).Control(3)=   "pbDeletePhone"
  222.       Tab(1).Control(4)=   "Frame3"
  223.       Tab(1).Control(5)=   "efFormattedPhoneNumber"
  224.       Tab(1).Control(6)=   "Label1(21)"
  225.       Begin VB.ListBox List3 
  226.          Height          =   1815
  227.          Left            =   -74880
  228.          TabIndex        =   26
  229.          Top             =   480
  230.          Width           =   4095
  231.       End
  232.       Begin VB.ListBox List2 
  233.          Height          =   1230
  234.          Left            =   120
  235.          TabIndex        =   14
  236.          Top             =   480
  237.          Width           =   4095
  238.       End
  239.       Begin VB.CommandButton pbAddPhone 
  240.          Caption         =   "Add New"
  241.          Height          =   375
  242.          Left            =   -67320
  243.          TabIndex        =   29
  244.          Top             =   480
  245.          Width           =   975
  246.       End
  247.       Begin VB.CommandButton pbUpdatePhone 
  248.          Caption         =   "Update"
  249.          Height          =   375
  250.          Left            =   -67320
  251.          TabIndex        =   30
  252.          Top             =   960
  253.          Width           =   975
  254.       End
  255.       Begin VB.CommandButton pbDeletePhone 
  256.          Caption         =   "Delete"
  257.          Height          =   375
  258.          Left            =   -67320
  259.          TabIndex        =   31
  260.          Top             =   1440
  261.          Width           =   975
  262.       End
  263.       Begin VB.Frame Frame3 
  264.          Caption         =   "Address Details"
  265.          Height          =   2535
  266.          Left            =   -70680
  267.          TabIndex        =   45
  268.          Top             =   360
  269.          Width           =   3255
  270.          Begin VB.TextBox efUsage 
  271.             Height          =   285
  272.             Left            =   1200
  273.             TabIndex        =   28
  274.             Top             =   720
  275.             Width           =   1815
  276.          End
  277.          Begin VB.TextBox efPhoneNumber 
  278.             Height          =   285
  279.             Left            =   1200
  280.             TabIndex        =   27
  281.             Top             =   360
  282.             Width           =   1815
  283.          End
  284.          Begin VB.Label Label1 
  285.             Caption         =   "Usage"
  286.             Height          =   255
  287.             Index           =   16
  288.             Left            =   120
  289.             TabIndex        =   47
  290.             Top             =   720
  291.             Width           =   975
  292.          End
  293.          Begin VB.Label Label1 
  294.             Caption         =   "Phone Num"
  295.             Height          =   255
  296.             Index           =   15
  297.             Left            =   120
  298.             TabIndex        =   46
  299.             Top             =   360
  300.             Width           =   975
  301.          End
  302.       End
  303.       Begin VB.CommandButton pbAddNewAddress 
  304.          Caption         =   "Add New"
  305.          Height          =   375
  306.          Left            =   7680
  307.          TabIndex        =   23
  308.          Top             =   480
  309.          Width           =   975
  310.       End
  311.       Begin VB.CommandButton pbUpdateAddress 
  312.          Caption         =   "Update"
  313.          Height          =   375
  314.          Left            =   7680
  315.          TabIndex        =   24
  316.          Top             =   960
  317.          Width           =   975
  318.       End
  319.       Begin VB.CommandButton pbDeleteAddress 
  320.          Caption         =   "Delete"
  321.          Height          =   375
  322.          Left            =   7680
  323.          TabIndex        =   25
  324.          Top             =   1440
  325.          Width           =   975
  326.       End
  327.       Begin VB.Frame Frame2 
  328.          Caption         =   "Address Details"
  329.          Height          =   2535
  330.          Left            =   4320
  331.          TabIndex        =   38
  332.          Top             =   360
  333.          Width           =   3255
  334.          Begin VB.ComboBox lbxStateCodes 
  335.             Height          =   315
  336.             Left            =   1200
  337.             Sorted          =   -1  'True
  338.             TabIndex        =   19
  339.             Top             =   1800
  340.             Width           =   1815
  341.          End
  342.          Begin VB.TextBox efLine1 
  343.             Height          =   285
  344.             Left            =   1200
  345.             TabIndex        =   15
  346.             Top             =   360
  347.             Width           =   1815
  348.          End
  349.          Begin VB.TextBox efLine2 
  350.             Height          =   285
  351.             Left            =   1200
  352.             TabIndex        =   16
  353.             Top             =   720
  354.             Width           =   1815
  355.          End
  356.          Begin VB.TextBox efLine3 
  357.             Height          =   285
  358.             Left            =   1200
  359.             TabIndex        =   17
  360.             Top             =   1080
  361.             Width           =   1815
  362.          End
  363.          Begin VB.TextBox efCity 
  364.             Height          =   285
  365.             Left            =   1200
  366.             TabIndex        =   18
  367.             Top             =   1440
  368.             Width           =   1815
  369.          End
  370.          Begin VB.TextBox efZipCode 
  371.             Height          =   285
  372.             Left            =   1200
  373.             MaxLength       =   5
  374.             TabIndex        =   20
  375.             Top             =   2160
  376.             Width           =   735
  377.          End
  378.          Begin VB.TextBox efZipExtension 
  379.             Height          =   285
  380.             Left            =   2640
  381.             MaxLength       =   2
  382.             TabIndex        =   22
  383.             Top             =   2160
  384.             Width           =   375
  385.          End
  386.          Begin VB.TextBox efZipSupplement 
  387.             Height          =   285
  388.             Left            =   2040
  389.             MaxLength       =   4
  390.             TabIndex        =   21
  391.             Top             =   2160
  392.             Width           =   495
  393.          End
  394.          Begin VB.Label Label1 
  395.             Caption         =   "Line 1"
  396.             Height          =   255
  397.             Index           =   5
  398.             Left            =   120
  399.             TabIndex        =   44
  400.             Top             =   360
  401.             Width           =   975
  402.          End
  403.          Begin VB.Label Label1 
  404.             Caption         =   "Line 2"
  405.             Height          =   255
  406.             Index           =   6
  407.             Left            =   120
  408.             TabIndex        =   43
  409.             Top             =   720
  410.             Width           =   975
  411.          End
  412.          Begin VB.Label Label1 
  413.             Caption         =   "Line 3"
  414.             Height          =   255
  415.             Index           =   7
  416.             Left            =   120
  417.             TabIndex        =   42
  418.             Top             =   1080
  419.             Width           =   975
  420.          End
  421.          Begin VB.Label Label1 
  422.             Caption         =   "City"
  423.             Height          =   255
  424.             Index           =   10
  425.             Left            =   120
  426.             TabIndex        =   41
  427.             Top             =   1440
  428.             Width           =   975
  429.          End
  430.          Begin VB.Label Label1 
  431.             Caption         =   "State"
  432.             Height          =   255
  433.             Index           =   8
  434.             Left            =   120
  435.             TabIndex        =   40
  436.             Top             =   1800
  437.             Width           =   975
  438.          End
  439.          Begin VB.Label Label1 
  440.             Caption         =   "Zip Code"
  441.             Height          =   255
  442.             Index           =   9
  443.             Left            =   120
  444.             TabIndex        =   39
  445.             Top             =   2160
  446.             Width           =   975
  447.          End
  448.       End
  449.       Begin VB.Label efFormattedPhoneNumber 
  450.          BorderStyle     =   1  'Fixed Single
  451.          ForeColor       =   &H00FF0000&
  452.          Height          =   255
  453.          Left            =   -74880
  454.          TabIndex        =   51
  455.          Top             =   2640
  456.          Width           =   4095
  457.       End
  458.       Begin VB.Label Label1 
  459.          Caption         =   "Formatted Phone"
  460.          Height          =   255
  461.          Index           =   21
  462.          Left            =   -74880
  463.          TabIndex        =   50
  464.          Top             =   2400
  465.          Width           =   1575
  466.       End
  467.       Begin VB.Label efFormattedAddress 
  468.          BorderStyle     =   1  'Fixed Single
  469.          ForeColor       =   &H00FF0000&
  470.          Height          =   855
  471.          Left            =   120
  472.          TabIndex        =   49
  473.          Top             =   2040
  474.          Width           =   4095
  475.       End
  476.       Begin VB.Label Label1 
  477.          Caption         =   "Formatted Address"
  478.          Height          =   255
  479.          Index           =   13
  480.          Left            =   120
  481.          TabIndex        =   48
  482.          Top             =   1800
  483.          Width           =   1575
  484.       End
  485.    End
  486.    Begin VB.Label lblPersonDetails 
  487.       AutoSize        =   -1  'True
  488.       BackColor       =   &H00C0C0C0&
  489.       BorderStyle     =   1  'Fixed Single
  490.       Caption         =   "lblPersonDetails"
  491.       ForeColor       =   &H00000080&
  492.       Height          =   255
  493.       Left            =   0
  494.       TabIndex        =   58
  495.       Top             =   5880
  496.       Width           =   8775
  497.       WordWrap        =   -1  'True
  498.    End
  499.    Begin VB.Label efAge 
  500.       BorderStyle     =   1  'Fixed Single
  501.       ForeColor       =   &H00FF0000&
  502.       Height          =   255
  503.       Left            =   3600
  504.       TabIndex        =   55
  505.       Top             =   2280
  506.       Width           =   615
  507.    End
  508.    Begin VB.Label Label1 
  509.       Caption         =   "Age"
  510.       Height          =   255
  511.       Index           =   17
  512.       Left            =   3600
  513.       TabIndex        =   54
  514.       Top             =   2040
  515.       Width           =   375
  516.    End
  517.    Begin VB.Label Label1 
  518.       Caption         =   "Formatted Name"
  519.       Height          =   255
  520.       Index           =   14
  521.       Left            =   0
  522.       TabIndex        =   53
  523.       Top             =   2040
  524.       Width           =   1575
  525.    End
  526.    Begin VB.Label efFormattedName 
  527.       BorderStyle     =   1  'Fixed Single
  528.       ForeColor       =   &H00FF0000&
  529.       Height          =   255
  530.       Left            =   0
  531.       TabIndex        =   52
  532.       Top             =   2280
  533.       Width           =   3495
  534.    End
  535.    Begin VB.Menu muView 
  536.       Caption         =   "&View"
  537.       Begin VB.Menu muSortPersons 
  538.          Caption         =   "Sort Persons"
  539.          Begin VB.Menu muSortPersonByFirstName 
  540.             Caption         =   "By &First Name"
  541.          End
  542.          Begin VB.Menu muSortPersonByLastName 
  543.             Caption         =   "By &Last Name"
  544.          End
  545.          Begin VB.Menu muSortPersonByDateOfBirth 
  546.             Caption         =   "By Date of &Birth"
  547.          End
  548.          Begin VB.Menu muSortPersonByDateOfDeath 
  549.             Caption         =   "By Date of &Death"
  550.          End
  551.          Begin VB.Menu muSortPersonBySpouseFormattedName 
  552.             Caption         =   "By &Spouse's Formatted Name"
  553.          End
  554.       End
  555.       Begin VB.Menu muSortAddresses 
  556.          Caption         =   "Sort Addresses"
  557.          Begin VB.Menu muSortAddressByCity 
  558.             Caption         =   "By &City"
  559.          End
  560.          Begin VB.Menu muSortAddressByFormattedAddress 
  561.             Caption         =   "By &Formatted Address"
  562.          End
  563.          Begin VB.Menu muSortAddressByStateCode 
  564.             Caption         =   "By &State Code"
  565.          End
  566.          Begin VB.Menu muSortAddressByStateCapitalCity 
  567.             Caption         =   "By State &Capital City"
  568.          End
  569.          Begin VB.Menu muSortAddressByFormattedZip 
  570.             Caption         =   "By &Zip Code"
  571.          End
  572.       End
  573.    End
  574. End
  575. Attribute VB_Name = "CustomerDetailsListBoxNoDataControl"
  576. Attribute VB_Creatable = False
  577. Attribute VB_Exposed = False
  578. Option Explicit
  579.  
  580. ' This example show how the VBOF can
  581. '   support the VB application in an enriched
  582. '   object-oriented manner without the need
  583. '   for conventional, GUI-centric VB programming
  584. '   techniques, such as extensive the use of the
  585. '   VB DataControl.
  586. ' This example expoits the ability of the
  587. '   VBOFCollection to work in conjunction with
  588. '   the VBOFListBoxWrapper to control
  589. '   VB ListBoxes in an object-oriented manner
  590.  
  591. Private pvtCurrentPerson As Person
  592. Private pvtCurrentAddress As Address
  593. Private pvtCurrentPhone As Phone
  594. Private pvtState As State
  595.  
  596. Private pvtPersons As VBOFCollection
  597. Private pvtPersonsListBoxWrapper As VBOFListBoxWrapper
  598.  
  599. Private pvtAddresses As VBOFCollection
  600. Private pvtAddressesListBoxWrapper As VBOFListBoxWrapper
  601.  
  602. Private pvtPhones As VBOFCollection
  603. Private pvtPhonesListBoxWrapper As VBOFListBoxWrapper
  604.  
  605. Private pvtStates As VBOFCollection
  606. Private pvtStatesListBoxWrapper As VBOFListBoxWrapper
  607.  
  608. Private pvtGenderCodes As VBOFCollection
  609. Private pvtGenderCodesListBoxWrapper As VBOFListBoxWrapper
  610.  
  611. Private pvtMaritalStatusCodes As VBOFCollection
  612. Private pvtMaritalStatusCodesListBoxWrapper As VBOFListBoxWrapper
  613.  
  614. Public ObjectManager As VBOFObjectManager
  615.  
  616. Private Sub DisplayPersonalLineage()
  617.     lblPersonDetails = pvtCurrentPerson.PersonalInformation
  618. End Sub
  619.  
  620.  
  621.  
  622. Private Sub DisplayStateCapital()
  623.     If pvtCurrentAddress Is Nothing Then
  624.         Exit Sub
  625.     End If
  626.  
  627.     If pvtCurrentAddress.State Is Nothing _
  628.     Then
  629.         Exit Sub
  630.     End If
  631.  
  632.     lblPersonDetails = "Capital city of " & pvtCurrentAddress.State.StateName & " is " & pvtCurrentAddress.State.CapitalCity
  633. End Sub
  634.  
  635. Private Sub GetListBoxWrappers()
  636.     
  637.     Set pvtAddresses = _
  638.         New VBOFCollection
  639.         
  640.     Set pvtPhones = _
  641.         New VBOFCollection
  642.  
  643. ' attach the Collection, ListBox and ListBoxWrapper
  644.     Set pvtPersonsListBoxWrapper = _
  645.         ObjectManager. _
  646.             NewVBOFListBoxWrapper( _
  647.             Collection:=pvtPersons, _
  648.             ListBox:=List1)
  649.  
  650. ' attach the Collection, ListBox and ListBoxWrapper
  651.     Set pvtAddressesListBoxWrapper = _
  652.         ObjectManager. _
  653.             NewVBOFListBoxWrapper( _
  654.             Collection:=pvtAddresses, _
  655.             ListBox:=List2)
  656.  
  657. ' attach the Collection, ListBox and ListBoxWrapper
  658.     Set pvtPhonesListBoxWrapper = _
  659.         ObjectManager. _
  660.             NewVBOFListBoxWrapper( _
  661.             Collection:=pvtPhones, _
  662.             ListBox:=List3)
  663.  
  664. ' attach the Collection, ListBox and ListBoxWrapper
  665.     Set pvtStatesListBoxWrapper = _
  666.         ObjectManager. _
  667.             NewVBOFListBoxWrapper( _
  668.             Collection:=pvtStates, _
  669.             ListBox:=lbxStateCodes)
  670.  
  671.     pvtStatesListBoxWrapper. _
  672.         AddItems
  673.  
  674. ' attach the Collection, ListBox and ListBoxWrapper
  675.     Set pvtGenderCodesListBoxWrapper = _
  676.         ObjectManager. _
  677.             NewVBOFListBoxWrapper( _
  678.             Collection:=pvtGenderCodes, _
  679.             ListBox:=lbxGenderCodes)
  680.  
  681.     pvtGenderCodesListBoxWrapper. _
  682.         AddItems
  683.  
  684. ' attach the Collection, ListBox and ListBoxWrapper
  685.     Set pvtMaritalStatusCodesListBoxWrapper = _
  686.         ObjectManager. _
  687.             NewVBOFListBoxWrapper( _
  688.             Collection:=pvtMaritalStatusCodes, _
  689.             ListBox:=lbxMaritalStatusCodes)
  690.  
  691.     pvtMaritalStatusCodesListBoxWrapper. _
  692.         AddItems
  693.  
  694. End Sub
  695.  
  696. Private Sub RefreshAddressList(Optional Person As Variant)
  697.     
  698.     Set pvtAddresses = _
  699.         Person.Addresses
  700.     Set pvtAddresses.Parent = _
  701.         pvtCurrentPerson
  702.  
  703. ' rebind the Collection, ListBox and ListBoxWrapper
  704.     pvtAddressesListBoxWrapper.Rebind _
  705.         Collection:=pvtAddresses
  706.        
  707. ' populate the ListBox from the Addresses Collection
  708.     pvtAddressesListBoxWrapper.Clear
  709.     pvtAddressesListBoxWrapper.AddItems
  710.             
  711. ' set the ListIndex to the previously selected item
  712. '   or the first entry
  713.     If Not pvtCurrentAddress Is Nothing Then
  714.         pvtAddressesListBoxWrapper.ListIndex = _
  715.                 pvtAddresses.CollectionIndex _
  716.                     (Item:=pvtCurrentAddress) - 1
  717.     Else
  718.         pvtAddressesListBoxWrapper.ListIndex = 0
  719.     End If
  720.  
  721. ' get the object at the ListIndex
  722.     Set pvtCurrentAddress = _
  723.         pvtAddressesListBoxWrapper. _
  724.             ListIndexObject
  725.     
  726. ' display the current address
  727.     RefreshAddressFields
  728.     
  729. End Sub
  730.  
  731. Private Sub RefreshCustomerList()
  732.     
  733. ' populate the ListBox from the Persons Collection
  734.     pvtPersonsListBoxWrapper.Clear
  735.     pvtPersonsListBoxWrapper.AddItems
  736.                 
  737. ' set the ListIndex to the previously selected item
  738. '   or the first entry
  739.     If Not pvtCurrentPerson Is Nothing Then
  740.         If pvtPersons.CollectionIndex _
  741.             (Item:=pvtCurrentPerson) >= 0 Then
  742.             
  743.             pvtPersonsListBoxWrapper.ListIndex = _
  744.                 pvtPersons.CollectionIndex _
  745.                     (Item:=pvtCurrentPerson) - 1
  746.         
  747.         Else
  748.             pvtPersonsListBoxWrapper.ListIndex = 0
  749.                     
  750.             Set pvtCurrentPerson = _
  751.                 pvtPersonsListBoxWrapper. _
  752.                     ListIndexObject
  753.         End If
  754.     Else
  755.         If pvtPersonsListBoxWrapper.ListCount > 0 Then
  756.             pvtPersonsListBoxWrapper.ListIndex = 0
  757.             
  758.             Set pvtCurrentPerson = _
  759.                 pvtPersonsListBoxWrapper. _
  760.                     ListIndexObject
  761.         End If
  762.     End If
  763.  
  764. ' preselect the previously CurrentPerson
  765.     If Not pvtCurrentPerson Is Nothing Then
  766.         Set pvtPersonsListBoxWrapper. _
  767.             SelectObject = _
  768.                 pvtCurrentPerson
  769.     End If
  770. End Sub
  771.  
  772. Private Sub RefreshPhoneList(Optional Person As Variant)
  773.  
  774.     Set pvtPhones = _
  775.         Person.Phones
  776.     Set pvtPhones.Parent = _
  777.         pvtCurrentPerson
  778.  
  779. ' rebind the Collection, ListBox and ListBoxWrapper
  780.     pvtPhonesListBoxWrapper.Rebind _
  781.         Collection:=pvtPhones
  782.     
  783. ' populate the ListBox from the Phones Collection
  784.     pvtPhonesListBoxWrapper.Clear
  785.     pvtPhonesListBoxWrapper.AddItems
  786.             
  787. ' set the ListIndex to the first entry
  788. ' set the ListIndex to the previously selected item
  789. '   or the first entry
  790.     If Not pvtCurrentPhone Is Nothing Then
  791.         pvtPhonesListBoxWrapper.ListIndex = _
  792.                 pvtPhones.CollectionIndex _
  793.                     (Item:=pvtCurrentPhone) - 1
  794.     Else
  795.         pvtPhonesListBoxWrapper.ListIndex = 0
  796.     End If
  797.  
  798. ' get the object at the ListIndex
  799.     Set pvtCurrentPhone = _
  800.         pvtPhonesListBoxWrapper. _
  801.             ListIndexObject
  802.     
  803. ' display the current phone
  804.     RefreshPhoneFields
  805.     
  806. End Sub
  807.  
  808.  
  809. Private Sub Command1_Click()
  810.  
  811.     Dim tempCollection As Collection
  812.     Dim tempPerson As Person
  813.     Dim tempNameList As String
  814.     
  815.     Set tempCollection = _
  816.         pvtPersonsListBoxWrapper. _
  817.             SelectedObjects
  818.  
  819.     tempNameList = ""
  820.     For Each tempPerson In tempCollection
  821.         If tempNameList = "" Then
  822.             tempNameList = tempPerson.FormattedName
  823.         Else
  824.             tempNameList = tempNameList & ", " & vbCrLf & tempPerson.FormattedName
  825.         End If
  826.     Next tempPerson
  827.  
  828.     MsgBox "To demonstrate the '(Get) pvtListBoxSelectedObjects' method, there are " & tempCollection.Count & " selected items:" & vbCrLf & tempNameList & vbCrLf & vbCrLf & "The first of these selected entries will be unselected to demonstrate the '(Set) pvtListBoxSelectedObjects' method."
  829.     
  830.     tempCollection.Remove 1
  831.     Set pvtPersonsListBoxWrapper. _
  832.         SelectedObjects = tempCollection
  833.  
  834. End Sub
  835.  
  836.  
  837. Private Sub efFormattedAddress_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  838.     DisplayStateCapital
  839. End Sub
  840.  
  841.  
  842.  
  843. Private Sub efFormattedName_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  844.     DisplayPersonalLineage
  845. End Sub
  846.  
  847.  
  848. Private Sub Form_Load()
  849.     
  850.     Set pvtStates = _
  851.         pubStates
  852.     
  853.     Set pvtGenderCodes = _
  854.         pubGenderCodes
  855.     
  856.     Set pvtMaritalStatusCodes = _
  857.         pubMaritalStatusCodes
  858.     
  859.     Set pvtPersons = _
  860.         pubPersons
  861.     
  862.     GetListBoxWrappers
  863.     
  864.     RefreshCustomerList
  865.  
  866.     List1_Click
  867.  
  868.     RegisterForEvents
  869.  
  870. End Sub
  871.  
  872. Public Sub ObjectEventCallBack(Optional Event As Variant, Optional Object As Variant)
  873.  
  874.     Dim tempObjectType As String
  875.     Dim tempUCaseEvent As String
  876.  
  877.     On Local Error Resume Next
  878.  
  879.     tempObjectType = TypeName(Object)
  880.     tempUCaseEvent = UCase$(Event)
  881.  
  882.     If tempObjectType = "Person" Then
  883.         
  884.         If tempUCaseEvent = "REMOVEDITEM" _
  885.         Or tempUCaseEvent = "REPLACEDITEM" _
  886.         Or tempUCaseEvent = "CHANGED" _
  887.         Then
  888.             RefreshCustomerList
  889.             
  890.             If Object.ObjectID = pvtCurrentPerson.ObjectID Then
  891.                 RefreshCustomerFields
  892.             End If
  893.         End If
  894.     End If
  895.  
  896.     If tempObjectType = "Address" Then
  897.         RefreshAddressFields
  898.     End If
  899.  
  900.     If tempObjectType = "Phone" Then
  901.         RefreshPhoneFields
  902.     End If
  903.  
  904. End Sub
  905.  
  906.  
  907.  
  908. Private Sub RefreshAddressFields()
  909.     
  910.     On Local Error Resume Next
  911.     
  912.     If pvtCurrentAddress Is Nothing Or Err = 3021 Then
  913.         efLine1 = ""
  914.         efLine2 = ""
  915.         efLine3 = ""
  916.         efCity = ""
  917.         lbxStateCodes = ""
  918.         efZipCode = ""
  919.         efZipSupplement = ""
  920.         efZipExtension = ""
  921.         efFormattedAddress = ""
  922.         Exit Sub
  923.     End If
  924.     
  925.     efLine1 = pvtCurrentAddress.Line1
  926.     efLine2 = pvtCurrentAddress.Line2
  927.     efLine3 = pvtCurrentAddress.Line3
  928.     efCity = pvtCurrentAddress.City
  929.     lbxStateCodes = _
  930.         pvtCurrentAddress.State.StateCode
  931.     efZipCode = pvtCurrentAddress.ZipCode
  932.     efZipSupplement = pvtCurrentAddress.ZipSupplementString
  933.     efZipExtension = pvtCurrentAddress.ZipExtensionString
  934.     efFormattedAddress = pvtCurrentAddress.FormattedAddress
  935.     
  936.     Set pvtAddressesListBoxWrapper. _
  937.         SelectObject = _
  938.             pvtCurrentAddress
  939.     
  940. '    DisplayStateCapital
  941. End Sub
  942.  
  943. Private Function PopulateCurrentAddress()
  944.     
  945.     On Local Error Resume Next
  946.     
  947.     With pvtCurrentAddress
  948.         .Line1 = efLine1
  949.         .Line2 = efLine2
  950.         .Line3 = efLine3
  951.         .City = efCity
  952.         .ZipCode = efZipCode
  953.         .ZipSupplement = efZipSupplement
  954.         .ZipExtension = efZipExtension
  955.     End With
  956.  
  957.     Set pvtCurrentAddress.State = _
  958.         pvtStatesListBoxWrapper.ListIndexObject
  959.  
  960. End Function
  961.  
  962. Private Function PopulateCurrentPerson()
  963.     
  964.     On Local Error Resume Next
  965.     
  966.     With pvtCurrentPerson
  967.         .CustomerNumber = efCustomerNumber
  968.         .FirstName = efFirstName
  969.         .LastName = efLastName
  970.         .SSN = efSSN
  971.         .DateOfBirth = DateValue(efDateOfBirth)
  972.         .Sex = _
  973.             pvtGenderCodesListBoxWrapper. _
  974.                 ListIndexObject _
  975.                     (pvtGenderCodesListBoxWrapper.ListBox) _
  976.                 .GenderCode
  977.         .MaritalStatus = _
  978.             pvtMaritalStatusCodesListBoxWrapper. _
  979.                 ListIndexObject _
  980.                     (pvtMaritalStatusCodesListBoxWrapper.ListBox) _
  981.                 .MaritalStatusCode
  982.     End With
  983.  
  984. End Function
  985.  
  986. Private Function PopulateCurrentPhone()
  987.  
  988.     On Local Error Resume Next
  989.  
  990.     With pvtCurrentPhone
  991.         .PhoneNumber = efPhoneNumber
  992.         .Usage = efUsage
  993.     End With
  994.     
  995. End Function
  996.  
  997. Sub RefreshCustomerFields()
  998.     
  999.     On Local Error Resume Next
  1000.         
  1001. ' display the person's detail information
  1002.     efCustomerNumber = pvtCurrentPerson.CustomerNumber
  1003.     efFirstName = pvtCurrentPerson.FirstName
  1004.     efLastName = pvtCurrentPerson.LastName
  1005.     efSSN = pvtCurrentPerson.SSN
  1006.     efDateOfBirth = Format$(pvtCurrentPerson.DateOfBirth, "mm/dd/yyyy")
  1007.     lbxMaritalStatusCodes = pvtCurrentPerson.MaritalStatus
  1008.     lbxGenderCodes = pvtCurrentPerson.Sex
  1009.     efFormattedName = _
  1010.         pvtCurrentPerson.FormattedName
  1011.     efAge = pvtCurrentPerson.Age
  1012.     
  1013.     Set pvtPersonsListBoxWrapper. _
  1014.         SelectObject = _
  1015.             pvtCurrentPerson
  1016.  
  1017.     DisplayPersonalLineage
  1018. End Sub
  1019.  
  1020. Private Sub RefreshPhoneFields()
  1021.  
  1022.     On Local Error Resume Next
  1023.     
  1024.     If pvtCurrentPhone Is Nothing Or Err = 3021 Then
  1025.         efPhoneNumber = ""
  1026.         efUsage = ""
  1027.         efFormattedPhoneNumber = ""
  1028.         Exit Sub
  1029.     End If
  1030.     
  1031.     efPhoneNumber = pvtCurrentPhone.PhoneNumber
  1032.     efUsage = pvtCurrentPhone.Usage
  1033.     efFormattedPhoneNumber = pvtCurrentPhone.FormattedPhoneNumber
  1034.     
  1035.     Set pvtPhonesListBoxWrapper. _
  1036.         SelectObject = _
  1037.             pvtCurrentPhone
  1038.  
  1039. End Sub
  1040.  
  1041. Private Sub RegisterForEvents()
  1042.     
  1043. #If NoEventMgr = False Then
  1044.     ObjectManager.RegisterForObjectEvent _
  1045.         TriggerObjectType:="Person", _
  1046.         RegisterObject:=Me
  1047.     
  1048.     ObjectManager.RegisterForObjectEvent _
  1049.         TriggerObjectType:="Address", _
  1050.         RegisterObject:=Me
  1051.     
  1052.     ObjectManager.RegisterForObjectEvent _
  1053.         TriggerObjectType:="Phone", _
  1054.         RegisterObject:=Me
  1055.     
  1056.     ObjectManager.RegisterForCollectionEvent _
  1057.         Collection:=pvtPersons, _
  1058.         RegisterObject:=Me
  1059.  
  1060.     ObjectManager.RegisterForCollectionEvent _
  1061.         Collection:=pvtAddresses, _
  1062.         RegisterObject:=Me
  1063.  
  1064.     ObjectManager.RegisterForCollectionEvent _
  1065.         Collection:=pvtPhones, _
  1066.         RegisterObject:=Me
  1067. #End If
  1068.  
  1069. End Sub
  1070.  
  1071.  
  1072.  
  1073. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  1074.  
  1075.     Me.MousePointer = vbArrowHourglass
  1076.     
  1077.     ObjectManager.Form_QueryUnload _
  1078.         Me, _
  1079.         pvtPersonsListBoxWrapper, _
  1080.         pvtAddressesListBoxWrapper, _
  1081.         pvtPhonesListBoxWrapper, _
  1082.         pvtStatesListBoxWrapper, _
  1083.         pvtGenderCodesListBoxWrapper, _
  1084.         pvtMaritalStatusCodesListBoxWrapper
  1085.     
  1086.     Set pvtPersons = Nothing
  1087.     Set pvtAddresses = Nothing
  1088.     Set pvtPhones = Nothing
  1089.     Set pvtStates = Nothing
  1090.     Set pvtGenderCodes = Nothing
  1091.     Set pvtMaritalStatusCodes = Nothing
  1092.  
  1093. #If NoEventMgr = False Then
  1094.     ObjectManager. _
  1095.         UnRegisterForAllEvents _
  1096.         RegisterObject:=Me
  1097. #End If
  1098.     
  1099.     Me.MousePointer = vbArrow
  1100. End Sub
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106. Private Sub List1_Click()
  1107.  
  1108.     Dim tempObjectID As Long
  1109.  
  1110.     Set pvtCurrentPerson = _
  1111.         pvtPersonsListBoxWrapper. _
  1112.             ListIndexObject
  1113.     
  1114. ' These next two statements don't contribute anything
  1115. '   to the application, but they illustrate usages
  1116. '   of other interesting ListBoxWrapper methods.
  1117.     Set pvtPersonsListBoxWrapper. _
  1118.         SelectObject = _
  1119.         pvtCurrentPerson
  1120.     Set pvtCurrentPerson = _
  1121.         pvtPersonsListBoxWrapper. _
  1122.         SelectObject
  1123.  
  1124.     RefreshCustomerFields
  1125.  
  1126.     RefreshAddressList _
  1127.         pvtCurrentPerson
  1128.  
  1129.     RefreshPhoneList _
  1130.         pvtCurrentPerson
  1131.         
  1132.     DisplayPersonalLineage
  1133. End Sub
  1134.  
  1135. Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1136.     DisplayPersonalLineage
  1137. End Sub
  1138.  
  1139. Private Sub List2_Click()
  1140.  
  1141. ' get the object at the ListIndex
  1142.     Set pvtCurrentAddress = _
  1143.         pvtAddressesListBoxWrapper. _
  1144.             ListIndexObject
  1145.     
  1146. ' display the current address
  1147.     RefreshAddressFields
  1148. '    DisplayStateCapital
  1149. End Sub
  1150.  
  1151.  
  1152. Private Sub List2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1153.     DisplayStateCapital
  1154. End Sub
  1155.  
  1156. Private Sub List3_Click()
  1157.  
  1158. ' get the object at the ListIndex
  1159.     Set pvtCurrentPhone = _
  1160.         pvtPhonesListBoxWrapper. _
  1161.             ListIndexObject
  1162.     
  1163. ' display the current phone
  1164.     RefreshPhoneFields
  1165.  
  1166. End Sub
  1167.  
  1168.  
  1169. Private Sub muSortAddressByCity_Click()
  1170.     Me.MousePointer = vbArrowHourglass
  1171.     
  1172.     pvtAddressesListBoxWrapper.Sort _
  1173.         SortField:="City", _
  1174.         SortOrder:="ASC"
  1175.  
  1176.     Me.MousePointer = vbArrow
  1177. End Sub
  1178.  
  1179. Private Sub muSortPersonByDateOfBirth_Click()
  1180.     Me.MousePointer = vbArrowHourglass
  1181.     
  1182.     pvtPersonsListBoxWrapper.Sort _
  1183.         SortField:="DateOfBirth", _
  1184.         SortOrder:="ASC"
  1185.  
  1186.     Me.MousePointer = vbArrow
  1187. End Sub
  1188.  
  1189. Private Sub muSortPersonByDateOfDeath_Click()
  1190.     Me.MousePointer = vbArrowHourglass
  1191.     
  1192.     pvtPersonsListBoxWrapper.Sort _
  1193.         SortField:="DateOfDeath", _
  1194.         SortOrder:="ASC"
  1195.  
  1196.     Me.MousePointer = vbArrow
  1197. End Sub
  1198.  
  1199.  
  1200. Private Sub muSortPersonByFirstName_Click()
  1201.     Me.MousePointer = vbArrowHourglass
  1202.     
  1203.     pvtPersonsListBoxWrapper.Sort _
  1204.         SortField:="FirstName", _
  1205.         SortOrder:="ASC"
  1206.  
  1207.     Me.MousePointer = vbArrow
  1208. End Sub
  1209.  
  1210.  
  1211. Private Sub muSortPersonByLastName_Click()
  1212.     Me.MousePointer = vbArrowHourglass
  1213.     
  1214.     pvtPersonsListBoxWrapper.Sort _
  1215.         SortField:="LastName", _
  1216.         SortOrder:="ASC"
  1217.  
  1218.     Me.MousePointer = vbArrow
  1219. End Sub
  1220.  
  1221.  
  1222. Private Sub muSortPersonBySpouseFormattedName_Click()
  1223.     Me.MousePointer = vbArrowHourglass
  1224.     
  1225.     pvtPersonsListBoxWrapper.Sort _
  1226.         SortField:="SpouseFormattedName", _
  1227.         SortOrder:="ASC"
  1228.  
  1229.     Me.MousePointer = vbArrow
  1230. End Sub
  1231.  
  1232.  
  1233. Private Sub muSortAddressByFormattedAddress_Click()
  1234.     Me.MousePointer = vbArrowHourglass
  1235.     
  1236.     pvtAddressesListBoxWrapper.Sort _
  1237.         SortField:="FormattedAddress", _
  1238.         SortOrder:="ASC"
  1239.  
  1240.     Me.MousePointer = vbArrow
  1241. End Sub
  1242.  
  1243.  
  1244. Private Sub muSortAddressByFormattedZip_Click()
  1245.     Me.MousePointer = vbArrowHourglass
  1246.     
  1247.     pvtAddressesListBoxWrapper.Sort _
  1248.         SortField:="ZipCode", _
  1249.         SortOrder:="ASC"
  1250.  
  1251.     Me.MousePointer = vbArrow
  1252. End Sub
  1253.  
  1254.  
  1255. Private Sub muSortAddressByStateCapitalCity_Click()
  1256.     Me.MousePointer = vbArrowHourglass
  1257.     
  1258.     pvtAddressesListBoxWrapper.Sort _
  1259.         SortField:="StateCapitalCity", _
  1260.         SortOrder:="ASC"
  1261.  
  1262.     Me.MousePointer = vbArrow
  1263. End Sub
  1264.  
  1265.  
  1266. Private Sub muSortAddressByStateCode_Click()
  1267.     Me.MousePointer = vbArrowHourglass
  1268.     
  1269.     pvtAddressesListBoxWrapper.Sort _
  1270.         SortField:="StateCode", _
  1271.         SortOrder:="ASC"
  1272.  
  1273.     Me.MousePointer = vbArrow
  1274. End Sub
  1275.  
  1276.  
  1277. Private Sub pbAddNewAddress_Click()
  1278.     
  1279.     Dim tempNewAddress As New Address
  1280.         
  1281.     On Local Error Resume Next
  1282.     Me.MousePointer = vbArrowHourglass
  1283.  
  1284.     Set pvtCurrentAddress = tempNewAddress
  1285.     
  1286.     PopulateCurrentAddress
  1287.             
  1288.     Set pvtCurrentAddress = _
  1289.         pvtCurrentPerson.AddAddress _
  1290.             (Item:=tempNewAddress)
  1291.         
  1292.     RefreshAddressList pvtCurrentPerson
  1293.     
  1294.     Me.MousePointer = vbArrow
  1295. End Sub
  1296.  
  1297. Private Sub pbAddNewCustomer_Click()
  1298.  
  1299.     Dim tempNewPerson As New Person
  1300.         
  1301.     On Local Error Resume Next
  1302.     Me.MousePointer = vbArrowHourglass
  1303.  
  1304.     Set pvtCurrentPerson = tempNewPerson
  1305.     
  1306.     PopulateCurrentPerson
  1307.     
  1308.     Set pvtCurrentPerson = _
  1309.         pvtPersons.Add _
  1310.             (Item:=tempNewPerson)
  1311.         
  1312.     RefreshAddressList pvtCurrentPerson
  1313.     RefreshPhoneList pvtCurrentPerson
  1314.  
  1315.     Me.MousePointer = vbArrow
  1316. End Sub
  1317.  
  1318. Private Sub pbAddPhone_Click()
  1319.  
  1320.     Dim tempNewPhone As New Phone
  1321.         
  1322.     On Local Error Resume Next
  1323.     Me.MousePointer = vbArrowHourglass
  1324.  
  1325.     Set pvtCurrentPhone = tempNewPhone
  1326.  
  1327.     PopulateCurrentPhone
  1328.             
  1329.     Set pvtCurrentPhone = _
  1330.         pvtCurrentPerson.AddPhone _
  1331.             (Item:=tempNewPhone)
  1332.         
  1333.     RefreshPhoneList pvtCurrentPerson
  1334.  
  1335.     Me.MousePointer = vbArrow
  1336. End Sub
  1337.  
  1338.  
  1339. Private Sub pbDeleteAddress_Click()
  1340.         
  1341.     On Local Error Resume Next
  1342.     Me.MousePointer = vbArrowHourglass
  1343.     
  1344.     pvtAddresses.Remove _
  1345.         Item:=pvtCurrentAddress
  1346.         
  1347.     Set pvtCurrentAddress = Nothing
  1348.         
  1349.     RefreshAddressList pvtCurrentPerson
  1350.  
  1351.     Me.MousePointer = vbArrow
  1352. End Sub
  1353.  
  1354. Private Sub pbDeleteCustomer_Click()
  1355.         
  1356.     On Local Error Resume Next
  1357.     Me.MousePointer = vbArrowHourglass
  1358.     
  1359. MsgBox "Test this code."
  1360.     pvtPersonsListBoxWrapper.RemoveObject _
  1361.         pvtCurrentPerson
  1362.     
  1363.     Set pvtCurrentPerson = Nothing
  1364.         
  1365.     RefreshCustomerList
  1366.  
  1367.     Me.MousePointer = vbArrow
  1368. End Sub
  1369.  
  1370.  
  1371. Private Sub pbDeletePhone_Click()
  1372.         
  1373.     On Local Error Resume Next
  1374.     Me.MousePointer = vbArrowHourglass
  1375.     
  1376.     pvtPhones.Remove _
  1377.         Item:=pvtCurrentPhone
  1378.         
  1379.     Set pvtCurrentPhone = Nothing
  1380.         
  1381.     RefreshPhoneList pvtCurrentPerson
  1382.  
  1383.     Me.MousePointer = vbArrow
  1384. End Sub
  1385.  
  1386.  
  1387. Private Sub pbOK_Click()
  1388.     Unload Me
  1389. End Sub
  1390.  
  1391. Private Sub pbUpdateAddress_Click()
  1392.           
  1393.     On Local Error Resume Next
  1394.     Me.MousePointer = vbArrowHourglass
  1395.  
  1396.     PopulateCurrentAddress
  1397.   
  1398.     pvtAddresses.Replace _
  1399.         Item:=pvtCurrentAddress, _
  1400.         ReplaceWith:=pvtCurrentAddress
  1401.         
  1402. ' trigger the "Changed" event
  1403. ' Note:  This typically a responsibility of the BOM.
  1404. '   But in this demo package, if it were, then the
  1405. '   demo window which is based on the DataControl
  1406. '   would do bunches of database I/O and run for
  1407. '   an extraordinary period.
  1408.     pvtCurrentAddress. _
  1409.         ObjectHasChanged
  1410.         
  1411.     RefreshAddressList pvtCurrentPerson
  1412.  
  1413.     Me.MousePointer = vbArrow
  1414. End Sub
  1415.  
  1416. Private Sub pbUpdateCustomer_Click()
  1417.         
  1418.     On Local Error Resume Next
  1419.     Me.MousePointer = vbArrowHourglass
  1420.     
  1421.     PopulateCurrentPerson
  1422.     
  1423.     pvtPersons.Replace _
  1424.         Item:=pvtCurrentPerson, _
  1425.         ReplaceWith:=pvtCurrentPerson
  1426.  
  1427. ' trigger the "Changed" event
  1428. ' Note:  This typically a responsibility of the BOM.
  1429. '   But in this demo package, if it were, then the
  1430. '   demo window which is based on the DataControl
  1431. '   would do bunches of database I/O and run for
  1432. '   an extraordinary period.
  1433.     pvtCurrentPerson. _
  1434.         ObjectHasChanged
  1435.         
  1436.     RefreshCustomerList
  1437.  
  1438.     Me.MousePointer = vbArrow
  1439. End Sub
  1440.  
  1441.  
  1442. Private Sub pbUpdatePhone_Click()
  1443.         
  1444.     On Local Error Resume Next
  1445.     Me.MousePointer = vbArrowHourglass
  1446.  
  1447.     PopulateCurrentPhone
  1448.   
  1449.     pvtPhones.Replace _
  1450.         Item:=pvtCurrentPhone, _
  1451.         ReplaceWith:=pvtCurrentPhone
  1452.         
  1453. ' trigger the "Changed" event
  1454. ' Note:  This typically a responsibility of the BOM.
  1455. '   But in this demo package, if it were, then the
  1456. '   demo window which is based on the DataControl
  1457. '   would do bunches of database I/O and run for
  1458. '   an extraordinary period.
  1459.     pvtCurrentPhone. _
  1460.         ObjectHasChanged
  1461.         
  1462.     RefreshPhoneList pvtCurrentPerson
  1463.  
  1464.     Me.MousePointer = vbArrow
  1465. End Sub
  1466.  
  1467.  
  1468.  
  1469.